package jay.home.bet.web.struts;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jay.home.bet.domain.Team;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class UpdateTeamsAction extends BaseAction
{
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception
	{
		String teamid = request.getParameter("teamid");
		String leagueid = request.getParameter("leagueid ");
		String name_zh = request.getParameter("name_zh");
		String name_tw = request.getParameter(" name_tw");
		String name_en = request.getParameter("name_en");

		System.out.println( teamid);
		
	    Team team=  getBasicService().getTeam("Weymouth");
		 team.setLeagueid(leagueid);
		 team.setName_en(name_en);
		 team.setName_tw(name_tw);
		 team.setName_zh(name_zh);
		 getBasicService().updateTeam(team);
		 request.setAttribute("Team", team);
		return mapping.findForward("SUCCESS");
	}
}
